﻿using System;
using System.Web;
using TokenAuthority;
namespace RestService
{
    public class RestServiceImpl : IRestServiceImpl
    {
        #region IRestServiceImpl Members

        public string GetToken(string user, string pass)
        {
            try
            {
                return TokenProvider.GetToken(HttpContext.Current.Request.UserHostAddress, user, Utils.Hash(pass));
            }
            catch (ValidationException)
            {
                return string.Empty;
            }
        }

        #endregion
    }
}